home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-02-28 | 5.5 KB | 211 lines | [TEXT/MPS ] |
- // Copyright © 1993, 1994 by Apple Computer, Inc. All rights reserved.
-
- constant kAppSymbol := '|AuxForm:PIEDTS|;
- constant kBusinessFormat := '|businessFormat:AuxForm:PIEDTS|;
- constant kAuxFormat := '|myAuxFormat:AuxForm:PIEDTS|;
- // ---- End Project Data ----
-
- // ---- Beginning of Print templates ----
-
- // ---- File mainFormat ----
-
- // Before Script for "printFormat_mainFormat"
- // Copyright © 1993, 1994 by Apple Computer, Inc. All rights reserved.
-
- printFormat_mainFormat :=
- {
- printNextPageScript:
- func()
- begin
- nil;
- end,
- _proto: protoPrintFormat,
- debug: "printFormat_mainFormat"
- };
-
-
- // Before Script for "_view000"
- // Copyright © 1993, 1994 by Apple Computer, Inc. All rights reserved.
-
- _view000 := /* child of printFormat_mainFormat */
- {text: "Hello, world!\n",
- viewBounds: {left: 0, top: 0, right: 0, bottom: 0},
- viewSetupFormScript:
- func()
- begin
- // wiggyField is set by the text from the
- // auxilliary slip
- self.text := if not StrEqual(fields.wiggyField, "") then
- fields.wiggyField
- else
- "Empty auxForm string" ;
- end,
- viewJustify: 246,
- viewFont: {family: ROM_espyFont, face: 0, size: 36}
- ,
- _proto: protoStaticText
- };
-
-
-
-
- // ---- End of Print templates ----
-
- // ---- File main.t ----
-
- // Before Script for "_view001"
- // Copyright © 1993, 1994 by Apple Computer, Inc. All rights reserved.
-
- _view001 :=
- {title: "AuxForm",
- viewBounds: {left: 0, top: 66, right: 221, bottom: 159},
- target: nil,
- routingFrame:
- //a simple routing frame
- {
- // something for printing
- print: {
- title: "Print Thing",
- routeForm: 'printSlip,
- formats: [kBusinessFormat]
- }
- };,
- viewSetupFormScript:
- func()
- begin
- GetGlobals().routing.(kAppSymbol) := routingFrame;
- targetView := self;
- GetRoot().(kBusinessFormat) := BuildContext(businessFormat);
-
- // get my auxilliary format (auxForm), just use a proto
- // to get the information
- GetRoot().(kAuxFormat) := BuildContext(pt_myAuxFormat);
-
- // need to set target to a cursor Entry!
- target := Query(GetUnionSoup("Names"), {type: 'index}):Entry() ;
- end,
- viewQuitScript:
- func()
- begin
- RemoveSlot(GetGlobals().routing, kAppSymbol);
- RemoveSlot(GetRoot(), kBusinessFormat);
- RemoveSlot(GetRoot(), kAuxFormat);
- end,
- targetView: nil,
- businessFormat:
- {
- title: "Business",
-
- // this is a symbol for your foramt. It is totally
- // arbitrary since you jam the format into the root
- // view. The only requirement is that the slot name
- // in the rootView matches this symbol. What you
- // jam in there is up to you.
- // see your viewSetupFormScript for the jam in.
- auxForm: kAuxFormat,
-
- // used by mail for text only sending
- textScript: nil,
- attachment: true,
- _proto: ROM_coverPageFormat,
-
- mainFormat: printFormat_mainFormat
- },
- setupRoutingSlip:
- func(fields)
- begin
- // fields.target := target ;
- fields.title := "Look ma, no hands" ;
- end,
- _proto: protoApp
- };
-
-
- // Before Script for "_view002"
- // Copyright © 1993, 1994 by Apple Computer, Inc. All rights reserved.
-
- _view002 := /* child of _view001 */ {_proto: protoActionButton};
-
-
-
-
- // ---- Beginning of non-used User Protos ----
-
- // ---- File myAuxFormat ----
-
- // Before Script for "mySlip"
- // Copyright © 1993, 1994 by Apple Computer, Inc. All rights reserved.
-
- mySlip :=
- {viewBounds: {left: 4, top: 174, right: 192, bottom: 242},
- viewSetupFormScript:
- func()
- begin
- // adjust viewbounds to be right under the printslip
- // (or faxslip, they both have the same bottom)
- local printBounds := GetRoot().printslip.viewBounds ;
- local myHeight := viewBounds.bottom - viewBounds.top ;
- local newViewbounds := {} ;
-
- newViewBounds.left := printBounds.left ;
- // add 10 to account for frame of this floater and
- // the other floater (i.e., frame size is in addition
- // to viewBounds.
- newViewBounds.top := printBounds.bottom + 10 ;
- newViewBounds.right := printBounds.right ;
- newViewBounds.bottom := newViewBounds.top + myHeight + 10 ;
-
- self.viewBounds := newViewBounds ;
-
- end,
- _proto: protoFloater,
- debug: "mySlip"
- };
-
-
- // Before Script for "_view003"
- // Copyright © 1993, 1994 by Apple Computer, Inc. All rights reserved.
-
- _view003 := /* child of mySlip */
- {viewBounds: {left: 8, top: 24, right: 192, bottom: 56},
- labelCommands: ["one", "two"],
- label: "Print This:",
- textChanged:
- func()
- begin
- fields.wiggyField := text ;
- end,
- textSetup:
- func()
- begin
- text := "" ;
- fields.wiggyField := text ;
- end,
- _proto: protoLabelInputLine
- };
-
-
-
-
- // Before Script for "explanation"
- // Copyright © 1993, 1994 by Apple Computer, Inc. All rights reserved.
-
- explanation := /* child of mySlip */
- {text: "Text to print or fax",
- viewBounds: {left: 0, top: 0, right: 0, bottom: 16},
- viewJustify: 8388662,
- _proto: protoStaticText,
- debug: "explanation"
- };
- // View explanation is declared to mySlip
-
-
-
-
- // ---- End of non-used User Protos ----
-
-
-
- // ---- Beginning of section for non used Layout files ----
-
- // End of output